package Exception;

public class ThreadDemo3 {
    public static void main(String[] args) {
        Thread t1=new Thread(new Runnable() {
            @Override
            public void run() {
                while (true){
                    System.out.println("hello world");
                }
            }
        });
        Runnable r2=new Runnable() {
            @Override
            public void run() {
                while (true){
                    System.out.println("hello java");
                }
            }
        };
        Thread t2=new Thread(r2);
        t1.start();
        t2.start();

    }
}
